<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>axious</title>
  <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
</head>
<body>
  <button id="btn">anniu</button>
  <script>
   const btn = document.querySelector("#btn")
   btn.onclick = () => {
    axios({
      method:"post",
      url:"http://localhost:3000/students",
      data:{
        name:"唐僧",
        age:18,
        gender:"男",
        address:"女儿国"
      }
    }).then((res)=>{
      console.log(res);
    }).catch(()=>{
      console.log("出错了");
    })
   }
  </script>
</body>
</html>